//对外暴露路由配置
export const constantRoute = [
  //登录
  {
    path: '/login',
    component: () => import('@/views/login/index.vue'),
    name: 'login',
    meta: {
      title: '登录', //菜单需要的标题
      hidden: true,
      icon: 'Promotion', //菜单左侧的图标---支持element plus 的全部图标
    },
  },
  //登录成功的路由
  {
    path: '/',
    component: () => import('@/layout/index.vue'),
    name: 'layout',
    meta: {
      title: '', //菜单需要的标题
      hidden: false, //代表这个在菜单中是否隐藏
      icon: '',
    },
    redirect: '/home',
    children: [
      {
        path: '/home',
        component: () => import('@/views/home/index.vue'),
        name: 'Home',
        meta: {
          title: '首页', //菜单需要的标题
          hidden: false,
          icon: 'Sunset',
        },
      },
    ],
  },
  //404
  {
    path: '/404',
    component: () => import('@/views/404/index.vue'),
    name: '404',
    meta: {
      title: '404', //菜单需要的标题
      hidden: true,
      icon: 'Promotion',
    },
  },
  //其他的路由
  {
    path: '/:pathMatch(.*)*',
    redirect: '/404',
    name: 'Any',
    meta: {
      title: '任意路由', //菜单需要的标题
      hidden: true,
      icon: 'Promotion',
    },
  },
  //数据大屏
  {
    path: '/screen',
    component: () => import('@/views/screen/index.vue'),
    name: 'Screen',
    meta: {
      title: '数据大屏', //菜单需要的标题
      hidden: false,
      icon: 'Platform',
    },
  },
  //管理中心
  {
    path: '/manage',
    component: () => import('@/layout/index.vue'),
    name: 'Manage',
    meta: {
      title: '管理中心', //菜单需要的标题
      hidden: false, //代表这个在菜单中是否隐藏
      icon: 'Lock',
    },
    redirect: '/manage/user',
    children: [
      {
        path: '/manage/user',
        component: () => import('@/views/manage/user/index.vue'),
        name: 'User',
        meta: {
          title: '用户管理', //菜单需要的标题
          hidden: false,
          icon: 'UserFilled',
        },
      },
      {
        path: '/manage/permission',
        component: () => import('@/views/manage/permission/index.vue'),
        name: 'Permission',
        meta: {
          title: '分类管理', //菜单需要的标题
          hidden: false,
          icon: 'Coin',
        },
      },
      {
        path: '/manage/food',
        component: () => import('@/views/manage/food/index.vue'),
        name: 'Food',
        meta: {
          title: '菜品管理', //菜单需要的标题
          hidden: false,
          icon: 'Dish',
        },
      },
      {
        path: '/manage/order',
        component: () => import('@/views/manage/order/index.vue'),
        name: 'Order',
        meta: {
          title: '订单详情', //菜单需要的标题
          hidden: false,
          icon: 'List',
        },
      },
    ],
  },
]
